﻿using Architecture.Domain.Service;
using Architecture.Repository.Interface;
using Architeture.Domain;
using MediatR;
using RBAC.ZhuBoLin.Application.Command.RoleCommand.Farminginfo;

namespace RBAC.ZhuBoLin.Application.CommandHandlers.RoleHandler.Farminginfo
{
    public class FarmingSelectCommandHandler : IRequestHandler<FarmingSelectCommand, Farming>
    {
        protected readonly IFarmingService farmingService;

        public FarmingSelectCommandHandler(IFarmingService farmingService)
        {
            this.farmingService = farmingService;
        }

        public async Task<Farming> Handle(FarmingSelectCommand request, CancellationToken cancellationToken)
        {
            return await farmingService.farmingList(request.id);
        }
    }
}
